home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / QuickTime™ 1.0 Interfaces / ImageCodec.lisp < prev    next >
Encoding:
Text File  |  1993-09-16  |  7.9 KB  |  229 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; 
  3. ; Created: Friday, September 27, 1991 10:04:39 AM
  4. ;  ImageCodec.p
  5. ;  Pascal Interface to the Macintosh Libraries
  6. ;  Copyright Apple Computer, Inc. 1991
  7. ;  All rights reserved
  8.  
  9. ; $IFC UNDEFINED UsingIncludes
  10. ; $SETC UsingIncludes := 0
  11. ; $ENDC
  12.  
  13. ; $IFC NOT UsingIncludes
  14.  
  15. ; $ENDC
  16.  
  17. ; $IFC UNDEFINED UsingImageCodec
  18. ; $SETC UsingImageCodec := 1
  19.  
  20. ; $I+
  21. ; $SETC ImageCodecIncludes := UsingIncludes
  22. ; $SETC UsingIncludes := 1
  23. ; $IFC UNDEFINED UsingQuickDraw
  24.  
  25. (require-interface 'QUICKDRAW)  ; $I $$Shell(PInterfaces)QuickDraw.p
  26. ; $ENDC
  27. ; $IFC UNDEFINED UsingQDOffscreen
  28.  
  29. (require-interface 'QDOFFSCREEN); $I $$Shell(PInterfaces)QDOffscreen.p
  30. ; $ENDC
  31.  
  32. ; $IFC UNDEFINED UsingTypes
  33.  
  34. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  35. ; $ENDC
  36.  
  37. ; $IFC UNDEFINED UsingComponents
  38.  
  39. (require-interface 'COMPONENTS) ; $I $$Shell(PInterfaces)Components.p
  40. ; $ENDC
  41.  
  42. ; $IFC UNDEFINED UsingImageCompression
  43.  
  44. (require-interface 'IMAGECOMPRESSION); $I $$Shell(PInterfaces)ImageCompression.p
  45. ; $ENDC
  46.  
  47. ; $SETC UsingIncludes := ImageCodecIncludes
  48.  
  49. ;     codec component selectors    
  50. ;     codec selectors 0-127 are reserved by Apple 
  51. ;     codec selectors 128-191 are subtype specific 
  52. ;     codec selectors 192-255 are vendor specific 
  53. ;      codec selectors 256-32767 are reserved by Apple 
  54. ;     negative selectors are reserved by the Component Manager 
  55.  
  56. (defconstant $codecGetCodecInfo #X0)
  57. (defconstant $codecGetCompressionTime #X1)
  58. (defconstant $codecGetMaxCompressionSize #X2)
  59. (defconstant $codecPreCompress #X3)
  60. (defconstant $codecBandCompress #X4)
  61. (defconstant $codecPreDecompress #X5)
  62. (defconstant $codecBandDecompress #X6)
  63. (defconstant $codecCDSequenceBusy #X7)
  64. (defconstant $codecGetCompressedImageSize #X8)
  65. (defconstant $codecGetSimilarity #X9)
  66. (defconstant $codecTrimImage #XA)
  67.  
  68. ;     codec capabilities flags    
  69.  
  70. (defconstant $codecCanScale #X1)
  71. (defconstant $codecCanMask #X2)
  72. (defconstant $codecCanMatte #X4)
  73. (defconstant $codecCanTransform #X8)
  74. (defconstant $codecCanTransferMode #X10)
  75. (defconstant $codecCanCopyPrev #X20)
  76. (defconstant $codecCanSpool #X40)
  77. (defconstant $codecCanClipVertical #X80)
  78. (defconstant $codecCanClipRectangular #X100)
  79. (defconstant $codecCanRemapColor #X200)
  80. (defconstant $codecCanFastDither #X400)
  81. (defconstant $codecCanSrcExtract #X800)
  82. (defconstant $codecCanCopyPrevComp #X1000)
  83. (defconstant $codecCanAsync #X2000)
  84. (defconstant $codecCanMakeMask #X4000)
  85. (defconstant $codecCanShift #X8000)
  86.  
  87. (defconstant $codecConditionFirstBand #X1)
  88. (defconstant $codecConditionLastBand #X2)
  89. (defconstant $codecConditionCodecChangedMask #X80000000)
  90.  
  91. (defconstant $codecInfoResourceType :|cdci|);  codec info resource type 
  92.  
  93. (defrecord CodecCapabilities 
  94.    (flags :SIGNED-LONG)
  95.    (wantedPixelSize :SIGNED-INTEGER)
  96.    (extendWidth :SIGNED-INTEGER)
  97.    (extendHeight :SIGNED-INTEGER)
  98.    (bandMin :SIGNED-INTEGER)
  99.    (bandInc :SIGNED-INTEGER)
  100.    (pad :SIGNED-INTEGER)
  101.    (time :SIGNED-INTEGER)
  102.    )
  103. (def-mactype :CODECCAPABILITIESPTR (find-mactype :POINTER))
  104.  
  105. (defrecord CodecCompressParams 
  106.    (sequenceID :SIGNED-LONG)    ;  precompress,bandcompress 
  107.    (imageDescription (:HANDLE :IMAGEDESCRIPTION));  precompress,bandcompress 
  108.    (data :POINTER)
  109.    (bufferSize :SIGNED-LONG)
  110.    (frameNumber :SIGNED-LONG)
  111.    (startLine :SIGNED-LONG)
  112.    (stopLine :SIGNED-LONG)
  113.    (conditionFlags :SIGNED-LONG)
  114.    (callerFlags :SIGNED-INTEGER)
  115.    (capabilities (:POINTER :CODECCAPABILITIES));  precompress,bandcompress 
  116.    (ProgressProcRecord :PROGRESSPROCRECORD)
  117.    (CompletionProcRecord :COMPLETIONPROCRECORD)
  118.    (FlushProcRecord :FLUSHPROCRECORD)
  119.    (srcPixMap :PIXMAP)          ;  precompress,bandcompress 
  120.    (prevPixMap :PIXMAP)
  121.    (spatialQuality :SIGNED-LONG)
  122.    (temporalQuality :SIGNED-LONG)
  123.    (similarity :SIGNED-LONG)
  124.    (reserved (:ARRAY :SIGNED-LONG 2))
  125.    )
  126. (def-mactype :CODECCOMPRESSPARAMSPTR (find-mactype :POINTER))
  127.  
  128. (defrecord CodecDecompressParams 
  129.    (sequenceID :SIGNED-LONG)    ;  predecompress,banddecompress 
  130.    (imageDescription (:HANDLE :IMAGEDESCRIPTION));  predecompress,banddecompress 
  131.    (data :POINTER)
  132.    (bufferSize :SIGNED-LONG)
  133.    (frameNumber :SIGNED-LONG)
  134.    (startLine :SIGNED-LONG)
  135.    (stopLine :SIGNED-LONG)
  136.    (conditionFlags :SIGNED-LONG)
  137.    (callerFlags :SIGNED-INTEGER)
  138.    (capabilities (:POINTER :CODECCAPABILITIES));  predecompress,banddecompress 
  139.    (ProgressProcRecord :PROGRESSPROCRECORD)
  140.    (CompletionProcRecord :COMPLETIONPROCRECORD)
  141.    (DataProcRecord :DATAPROCRECORD)
  142.    (port (:POINTER :CGRAFPORT)) ;  predecompress,banddecompress 
  143.    (dstPixMap :PIXMAP)          ;  predecompress,banddecompress 
  144.    (maskBits (:POINTER :BITMAP))
  145.    (mattePixMap (:POINTER :PIXMAP))
  146.    (srcRect :RECT)              ;  predecompress,banddecompress 
  147.    (matrix (:POINTER :MATRIXRECORD));  predecompress,banddecompress 
  148.    (accuracy :SIGNED-LONG)      ;  predecompress,banddecompress 
  149.    (transferMode :SIGNED-INTEGER);  predecompress,banddecompress 
  150.    (reserved (:ARRAY :SIGNED-LONG 2))
  151.    )
  152. (def-mactype :CODECDECOMPRESSPARAMSPTR (find-mactype :POINTER))
  153.  
  154.  
  155. #| Not in ROM
  156. (deftrap _CDGETCODECINFO ((STORAGE :HANDLE) (INFO (:POINTER :CODECINFO)))
  157.    (:STACK :SIGNED-LONG)
  158.    (:STACK-TRAP #x0))
  159. |#
  160. #| Not in ROM
  161. (deftrap _CDGETCOMPRESSIONTIME ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DEPTH :SIGNED-INTEGER) (SPATIALQUALITY (:POINTER :SIGNED-LONG)) (TEMPORALQUALITY (:POINTER :SIGNED-LONG)) (TIME (:POINTER :SIGNED-LONG)))
  162.    (:STACK :SIGNED-LONG)
  163.    (:STACK-TRAP #x0))
  164. |#
  165. #| Not in ROM
  166. (deftrap _CDGETMAXCOMPRESSIONSIZE ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DEPTH :SIGNED-INTEGER) (QUALITY :SIGNED-LONG) (SIZE (:POINTER :SIGNED-LONG)))
  167.    (:STACK :SIGNED-LONG)
  168.    (:STACK-TRAP #x0))
  169. |#
  170. #| Not in ROM
  171. (deftrap _CDPRECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECCOMPRESSPARAMS)))
  172.    (:STACK :SIGNED-LONG)
  173.    (:STACK-TRAP #x0))
  174. |#
  175. #| Not in ROM
  176. (deftrap _CDBANDCOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECCOMPRESSPARAMS)))
  177.    (:STACK :SIGNED-LONG)
  178.    (:STACK-TRAP #x0))
  179. |#
  180. #| Not in ROM
  181. (deftrap _CDPREDECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECDECOMPRESSPARAMS)))
  182.    (:STACK :SIGNED-LONG)
  183.    (:STACK-TRAP #x0))
  184. |#
  185. #| Not in ROM
  186. (deftrap _CDBANDDECOMPRESS ((STORAGE :HANDLE) (PARAMS (:POINTER :CODECDECOMPRESSPARAMS)))
  187.    (:STACK :SIGNED-LONG)
  188.    (:STACK-TRAP #x0))
  189. |#
  190. #| Not in ROM
  191. (deftrap _CDCODECBUSY ((STORAGE :HANDLE) (SEQ :SIGNED-LONG))
  192.    (:STACK :SIGNED-LONG)
  193.    (:STACK-TRAP #x0))
  194. |#
  195. #| Not in ROM
  196. (deftrap _CDGETCOMPRESSEDIMAGESIZE ((STORAGE :HANDLE) (DESC (:HANDLE :IMAGEDESCRIPTION)) (DATA :POINTER) (BUFFERSIZE :SIGNED-LONG) (DATAPROC (:POINTER :DATAPROCRECORD)) (DATASIZE (:POINTER :SIGNED-LONG)))
  197.    (:STACK :SIGNED-LONG)
  198.    (:STACK-TRAP #x0))
  199. |#
  200. #| Not in ROM
  201. (deftrap _CDGETSIMILARITY ((STORAGE :HANDLE) (SRC (:HANDLE :PIXMAP)) (SRCRECT :RECT) (DESC (:HANDLE :IMAGEDESCRIPTION)) (DATA :POINTER) (SIMILARITY (:POINTER :SIGNED-LONG)))
  202.    (:STACK :SIGNED-LONG)
  203.    (:STACK-TRAP #x0))
  204. |#
  205. #| Not in ROM
  206. (deftrap _CDTRIMIMAGE ((STORAGE :HANDLE) (DESC (:HANDLE :IMAGEDESCRIPTION)) (INDATA :POINTER) (INBUFFERSIZE :SIGNED-LONG) (DATAPROC (:POINTER :DATAPROCRECORD)) (OUTDATA :POINTER) (OUTBUFFERSIZE :SIGNED-LONG) (FLUSHPROC (:POINTER :FLUSHPROCRECORD)) (TRIMRECT (:POINTER :RECT)) (PROGRESSPROC (:POINTER :PROGRESSPROCRECORD)))
  207.    (:STACK :SIGNED-LONG)
  208.    (:STACK-TRAP #x0))
  209. |#
  210. ; $ENDC
  211.  
  212.  
  213. (export '($CODECINFORESOURCETYPE $CODECCONDITIONCODECCHANGEDMASK
  214.           $CODECCONDITIONLASTBAND $CODECCONDITIONFIRSTBAND $CODECCANSHIFT
  215.           $CODECCANMAKEMASK $CODECCANASYNC $CODECCANCOPYPREVCOMP
  216.           $CODECCANSRCEXTRACT $CODECCANFASTDITHER $CODECCANREMAPCOLOR
  217.           $CODECCANCLIPRECTANGULAR $CODECCANCLIPVERTICAL $CODECCANSPOOL
  218.           $CODECCANCOPYPREV $CODECCANTRANSFERMODE $CODECCANTRANSFORM
  219.           $CODECCANMATTE $CODECCANMASK $CODECCANSCALE $CODECTRIMIMAGE
  220.           $CODECGETSIMILARITY $CODECGETCOMPRESSEDIMAGESIZE $CODECCDSEQUENCEBUSY
  221.           $CODECBANDDECOMPRESS $CODECPREDECOMPRESS $CODECBANDCOMPRESS
  222.           $CODECPRECOMPRESS $CODECGETMAXCOMPRESSIONSIZE
  223.           $CODECGETCOMPRESSIONTIME $CODECGETCODECINFO))
  224. (provide-interface 'ImageCodec)